/**
 */
package org.mro.grib.model.files.secondEdition.dataRepresentations.impl;

import java.nio.ByteBuffer;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationTemplate51;
import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationsPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Data Representation Template51</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getMatrixBitmapPresence <em>Matrix Bitmap Presence</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getNumberOfDataValues <em>Number Of Data Values</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getFirstDimension <em>First Dimension</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getSecondDimension <em>Second Dimension</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getFirstDimensionCoordinateValueDefinition <em>First Dimension Coordinate Value Definition</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getNc1 <em>Nc1</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getSecondDimensionCoordinateValueDefinition <em>Second Dimension Coordinate Value Definition</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getNc2 <em>Nc2</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getFirstDimensionPhysicalSignificance <em>First Dimension Physical Significance</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getSecondDimensionPhysicalSignificance <em>Second Dimension Physical Significance</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getFirstDimensionCoefficientsOffset <em>First Dimension Coefficients Offset</em>}</li>
 *   <li>{@link org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate51Impl#getSecondDimensionCoefficientsOffset <em>Second Dimension Coefficients Offset</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DataRepresentationTemplate51Impl extends DataRepresentationTemplate50Impl implements DataRepresentationTemplate51 {
	/**
	 * The default value of the '{@link #getMatrixBitmapPresence() <em>Matrix Bitmap Presence</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMatrixBitmapPresence()
	 * @generated
	 * @ordered
	 */
	protected static final byte MATRIX_BITMAP_PRESENCE_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getMatrixBitmapPresence() <em>Matrix Bitmap Presence</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMatrixBitmapPresence()
	 * @generated
	 * @ordered
	 */
	protected byte matrixBitmapPresence = MATRIX_BITMAP_PRESENCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getNumberOfDataValues() <em>Number Of Data Values</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfDataValues()
	 * @generated
	 * @ordered
	 */
	protected static final int NUMBER_OF_DATA_VALUES_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getNumberOfDataValues() <em>Number Of Data Values</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNumberOfDataValues()
	 * @generated
	 * @ordered
	 */
	protected int numberOfDataValues = NUMBER_OF_DATA_VALUES_EDEFAULT;

	/**
	 * The default value of the '{@link #getFirstDimension() <em>First Dimension</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimension()
	 * @generated
	 * @ordered
	 */
	protected static final short FIRST_DIMENSION_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getFirstDimension() <em>First Dimension</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimension()
	 * @generated
	 * @ordered
	 */
	protected short firstDimension = FIRST_DIMENSION_EDEFAULT;

	/**
	 * The default value of the '{@link #getSecondDimension() <em>Second Dimension</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimension()
	 * @generated
	 * @ordered
	 */
	protected static final short SECOND_DIMENSION_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getSecondDimension() <em>Second Dimension</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimension()
	 * @generated
	 * @ordered
	 */
	protected short secondDimension = SECOND_DIMENSION_EDEFAULT;

	/**
	 * The default value of the '{@link #getFirstDimensionCoordinateValueDefinition() <em>First Dimension Coordinate Value Definition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionCoordinateValueDefinition()
	 * @generated
	 * @ordered
	 */
	protected static final byte FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getFirstDimensionCoordinateValueDefinition() <em>First Dimension Coordinate Value Definition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionCoordinateValueDefinition()
	 * @generated
	 * @ordered
	 */
	protected byte firstDimensionCoordinateValueDefinition = FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT;

	/**
	 * The default value of the '{@link #getNc1() <em>Nc1</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNc1()
	 * @generated
	 * @ordered
	 */
	protected static final byte NC1_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getNc1() <em>Nc1</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNc1()
	 * @generated
	 * @ordered
	 */
	protected byte nc1 = NC1_EDEFAULT;

	/**
	 * The default value of the '{@link #getSecondDimensionCoordinateValueDefinition() <em>Second Dimension Coordinate Value Definition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionCoordinateValueDefinition()
	 * @generated
	 * @ordered
	 */
	protected static final byte SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getSecondDimensionCoordinateValueDefinition() <em>Second Dimension Coordinate Value Definition</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionCoordinateValueDefinition()
	 * @generated
	 * @ordered
	 */
	protected byte secondDimensionCoordinateValueDefinition = SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT;

	/**
	 * The default value of the '{@link #getNc2() <em>Nc2</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNc2()
	 * @generated
	 * @ordered
	 */
	protected static final byte NC2_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getNc2() <em>Nc2</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNc2()
	 * @generated
	 * @ordered
	 */
	protected byte nc2 = NC2_EDEFAULT;

	/**
	 * The default value of the '{@link #getFirstDimensionPhysicalSignificance() <em>First Dimension Physical Significance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionPhysicalSignificance()
	 * @generated
	 * @ordered
	 */
	protected static final byte FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getFirstDimensionPhysicalSignificance() <em>First Dimension Physical Significance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionPhysicalSignificance()
	 * @generated
	 * @ordered
	 */
	protected byte firstDimensionPhysicalSignificance = FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getSecondDimensionPhysicalSignificance() <em>Second Dimension Physical Significance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionPhysicalSignificance()
	 * @generated
	 * @ordered
	 */
	protected static final byte SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT = 0x00;

	/**
	 * The cached value of the '{@link #getSecondDimensionPhysicalSignificance() <em>Second Dimension Physical Significance</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionPhysicalSignificance()
	 * @generated
	 * @ordered
	 */
	protected byte secondDimensionPhysicalSignificance = SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getFirstDimensionCoefficientsOffset() <em>First Dimension Coefficients Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionCoefficientsOffset()
	 * @generated
	 * @ordered
	 */
	protected static final long FIRST_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT = 0L;

	/**
	 * The cached value of the '{@link #getFirstDimensionCoefficientsOffset() <em>First Dimension Coefficients Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFirstDimensionCoefficientsOffset()
	 * @generated
	 * @ordered
	 */
	protected long firstDimensionCoefficientsOffset = FIRST_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT;

	/**
	 * The default value of the '{@link #getSecondDimensionCoefficientsOffset() <em>Second Dimension Coefficients Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionCoefficientsOffset()
	 * @generated
	 * @ordered
	 */
	protected static final long SECOND_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT = 0L;

	/**
	 * The cached value of the '{@link #getSecondDimensionCoefficientsOffset() <em>Second Dimension Coefficients Offset</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSecondDimensionCoefficientsOffset()
	 * @generated
	 * @ordered
	 */
	protected long secondDimensionCoefficientsOffset = SECOND_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DataRepresentationTemplate51Impl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DataRepresentationsPackage.Literals.DATA_REPRESENTATION_TEMPLATE51;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getMatrixBitmapPresence() {
		return matrixBitmapPresence;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMatrixBitmapPresence(byte newMatrixBitmapPresence) {
		byte oldMatrixBitmapPresence = matrixBitmapPresence;
		matrixBitmapPresence = newMatrixBitmapPresence;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__MATRIX_BITMAP_PRESENCE, oldMatrixBitmapPresence, matrixBitmapPresence));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getNumberOfDataValues() {
		return numberOfDataValues;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNumberOfDataValues(int newNumberOfDataValues) {
		int oldNumberOfDataValues = numberOfDataValues;
		numberOfDataValues = newNumberOfDataValues;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NUMBER_OF_DATA_VALUES, oldNumberOfDataValues, numberOfDataValues));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public short getFirstDimension() {
		return firstDimension;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFirstDimension(short newFirstDimension) {
		short oldFirstDimension = firstDimension;
		firstDimension = newFirstDimension;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION, oldFirstDimension, firstDimension));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public short getSecondDimension() {
		return secondDimension;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSecondDimension(short newSecondDimension) {
		short oldSecondDimension = secondDimension;
		secondDimension = newSecondDimension;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION, oldSecondDimension, secondDimension));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getFirstDimensionCoordinateValueDefinition() {
		return firstDimensionCoordinateValueDefinition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFirstDimensionCoordinateValueDefinition(byte newFirstDimensionCoordinateValueDefinition) {
		byte oldFirstDimensionCoordinateValueDefinition = firstDimensionCoordinateValueDefinition;
		firstDimensionCoordinateValueDefinition = newFirstDimensionCoordinateValueDefinition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION, oldFirstDimensionCoordinateValueDefinition, firstDimensionCoordinateValueDefinition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getNc1() {
		return nc1;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNc1(byte newNc1) {
		byte oldNc1 = nc1;
		nc1 = newNc1;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC1, oldNc1, nc1));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getSecondDimensionCoordinateValueDefinition() {
		return secondDimensionCoordinateValueDefinition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSecondDimensionCoordinateValueDefinition(byte newSecondDimensionCoordinateValueDefinition) {
		byte oldSecondDimensionCoordinateValueDefinition = secondDimensionCoordinateValueDefinition;
		secondDimensionCoordinateValueDefinition = newSecondDimensionCoordinateValueDefinition;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION, oldSecondDimensionCoordinateValueDefinition, secondDimensionCoordinateValueDefinition));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getNc2() {
		return nc2;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNc2(byte newNc2) {
		byte oldNc2 = nc2;
		nc2 = newNc2;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC2, oldNc2, nc2));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getFirstDimensionPhysicalSignificance() {
		return firstDimensionPhysicalSignificance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFirstDimensionPhysicalSignificance(byte newFirstDimensionPhysicalSignificance) {
		byte oldFirstDimensionPhysicalSignificance = firstDimensionPhysicalSignificance;
		firstDimensionPhysicalSignificance = newFirstDimensionPhysicalSignificance;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE, oldFirstDimensionPhysicalSignificance, firstDimensionPhysicalSignificance));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public byte getSecondDimensionPhysicalSignificance() {
		return secondDimensionPhysicalSignificance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSecondDimensionPhysicalSignificance(byte newSecondDimensionPhysicalSignificance) {
		byte oldSecondDimensionPhysicalSignificance = secondDimensionPhysicalSignificance;
		secondDimensionPhysicalSignificance = newSecondDimensionPhysicalSignificance;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE, oldSecondDimensionPhysicalSignificance, secondDimensionPhysicalSignificance));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public long getFirstDimensionCoefficientsOffset() {
		return firstDimensionCoefficientsOffset;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFirstDimensionCoefficientsOffset(long newFirstDimensionCoefficientsOffset) {
		long oldFirstDimensionCoefficientsOffset = firstDimensionCoefficientsOffset;
		firstDimensionCoefficientsOffset = newFirstDimensionCoefficientsOffset;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COEFFICIENTS_OFFSET, oldFirstDimensionCoefficientsOffset, firstDimensionCoefficientsOffset));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public long getSecondDimensionCoefficientsOffset() {
		return secondDimensionCoefficientsOffset;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSecondDimensionCoefficientsOffset(long newSecondDimensionCoefficientsOffset) {
		long oldSecondDimensionCoefficientsOffset = secondDimensionCoefficientsOffset;
		secondDimensionCoefficientsOffset = newSecondDimensionCoefficientsOffset;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COEFFICIENTS_OFFSET, oldSecondDimensionCoefficientsOffset, secondDimensionCoefficientsOffset));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__MATRIX_BITMAP_PRESENCE:
				return getMatrixBitmapPresence();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NUMBER_OF_DATA_VALUES:
				return getNumberOfDataValues();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION:
				return getFirstDimension();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION:
				return getSecondDimension();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION:
				return getFirstDimensionCoordinateValueDefinition();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC1:
				return getNc1();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION:
				return getSecondDimensionCoordinateValueDefinition();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC2:
				return getNc2();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE:
				return getFirstDimensionPhysicalSignificance();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE:
				return getSecondDimensionPhysicalSignificance();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COEFFICIENTS_OFFSET:
				return getFirstDimensionCoefficientsOffset();
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COEFFICIENTS_OFFSET:
				return getSecondDimensionCoefficientsOffset();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__MATRIX_BITMAP_PRESENCE:
				setMatrixBitmapPresence((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NUMBER_OF_DATA_VALUES:
				setNumberOfDataValues((Integer)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION:
				setFirstDimension((Short)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION:
				setSecondDimension((Short)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION:
				setFirstDimensionCoordinateValueDefinition((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC1:
				setNc1((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION:
				setSecondDimensionCoordinateValueDefinition((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC2:
				setNc2((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE:
				setFirstDimensionPhysicalSignificance((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE:
				setSecondDimensionPhysicalSignificance((Byte)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COEFFICIENTS_OFFSET:
				setFirstDimensionCoefficientsOffset((Long)newValue);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COEFFICIENTS_OFFSET:
				setSecondDimensionCoefficientsOffset((Long)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__MATRIX_BITMAP_PRESENCE:
				setMatrixBitmapPresence(MATRIX_BITMAP_PRESENCE_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NUMBER_OF_DATA_VALUES:
				setNumberOfDataValues(NUMBER_OF_DATA_VALUES_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION:
				setFirstDimension(FIRST_DIMENSION_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION:
				setSecondDimension(SECOND_DIMENSION_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION:
				setFirstDimensionCoordinateValueDefinition(FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC1:
				setNc1(NC1_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION:
				setSecondDimensionCoordinateValueDefinition(SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC2:
				setNc2(NC2_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE:
				setFirstDimensionPhysicalSignificance(FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE:
				setSecondDimensionPhysicalSignificance(SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COEFFICIENTS_OFFSET:
				setFirstDimensionCoefficientsOffset(FIRST_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT);
				return;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COEFFICIENTS_OFFSET:
				setSecondDimensionCoefficientsOffset(SECOND_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__MATRIX_BITMAP_PRESENCE:
				return matrixBitmapPresence != MATRIX_BITMAP_PRESENCE_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NUMBER_OF_DATA_VALUES:
				return numberOfDataValues != NUMBER_OF_DATA_VALUES_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION:
				return firstDimension != FIRST_DIMENSION_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION:
				return secondDimension != SECOND_DIMENSION_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION:
				return firstDimensionCoordinateValueDefinition != FIRST_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC1:
				return nc1 != NC1_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION:
				return secondDimensionCoordinateValueDefinition != SECOND_DIMENSION_COORDINATE_VALUE_DEFINITION_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__NC2:
				return nc2 != NC2_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE:
				return firstDimensionPhysicalSignificance != FIRST_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE:
				return secondDimensionPhysicalSignificance != SECOND_DIMENSION_PHYSICAL_SIGNIFICANCE_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__FIRST_DIMENSION_COEFFICIENTS_OFFSET:
				return firstDimensionCoefficientsOffset != FIRST_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT;
			case DataRepresentationsPackage.DATA_REPRESENTATION_TEMPLATE51__SECOND_DIMENSION_COEFFICIENTS_OFFSET:
				return secondDimensionCoefficientsOffset != SECOND_DIMENSION_COEFFICIENTS_OFFSET_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (matrixBitmapPresence: "); //$NON-NLS-1$
		result.append(matrixBitmapPresence);
		result.append(", numberOfDataValues: "); //$NON-NLS-1$
		result.append(numberOfDataValues);
		result.append(", firstDimension: "); //$NON-NLS-1$
		result.append(firstDimension);
		result.append(", secondDimension: "); //$NON-NLS-1$
		result.append(secondDimension);
		result.append(", firstDimensionCoordinateValueDefinition: "); //$NON-NLS-1$
		result.append(firstDimensionCoordinateValueDefinition);
		result.append(", nc1: "); //$NON-NLS-1$
		result.append(nc1);
		result.append(", secondDimensionCoordinateValueDefinition: "); //$NON-NLS-1$
		result.append(secondDimensionCoordinateValueDefinition);
		result.append(", nc2: "); //$NON-NLS-1$
		result.append(nc2);
		result.append(", firstDimensionPhysicalSignificance: "); //$NON-NLS-1$
		result.append(firstDimensionPhysicalSignificance);
		result.append(", secondDimensionPhysicalSignificance: "); //$NON-NLS-1$
		result.append(secondDimensionPhysicalSignificance);
		result.append(", firstDimensionCoefficientsOffset: "); //$NON-NLS-1$
		result.append(firstDimensionCoefficientsOffset);
		result.append(", secondDimensionCoefficientsOffset: "); //$NON-NLS-1$
		result.append(secondDimensionCoefficientsOffset);
		result.append(')');
		return result.toString();
	}

	/* (non-Javadoc)
	 * @see org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationTemplate50Impl#initialise(java.nio.ByteBuffer)
	 */
	@Override
	public void initialise(ByteBuffer buffer) {
		super.initialise(buffer);
		matrixBitmapPresence = buffer.get();
		numberOfDataValues = buffer.getInt();
		firstDimension = buffer.getShort();
		secondDimension = buffer.getShort();
		firstDimensionCoordinateValueDefinition = buffer.get();
		nc1 = buffer.get();
		secondDimensionCoordinateValueDefinition = buffer.get();
		nc2 = buffer.get();
		firstDimensionPhysicalSignificance = buffer.get();
		secondDimensionPhysicalSignificance = buffer.get();
		firstDimensionCoefficientsOffset = buffer.position();
		secondDimensionCoefficientsOffset = buffer.position() + nc1 * Integer.SIZE / Byte.SIZE;
	}
	
} //DataRepresentationTemplate51Impl
